package com.example.interview.AOP;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Aspect // 定义切面
@Component
@Order(1)
public class AspectDemo4 {
 @Pointcut("execution(* com.example.interview.Controller.UserController.*(..))")
 private void pt(){}
 // 前置通知通知
 @Before("pt()")
 public void doBefore() {
  System.out.println("执行了前置通知4");
 }

 // 后置通知
 @After("pt()")
 public void doAfter() {
  System.out.println("执行了后置通知4");
 }
}